package com.sjy.ship.service.impl;

import java.util.List;
import com.sjy.common.utils.DateUtils;
import com.sjy.ship.domain.vo.ShipEcVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sjy.ship.mapper.ElectronicCouponMapper;
import com.sjy.ship.domain.ElectronicCoupon;
import com.sjy.ship.service.IElectronicCouponService;

/**
 * 电子联单Service业务层处理
 * 
 * @author lzm
 * @date 2023-06-14
 */
@Service
public class ElectronicCouponServiceImpl implements IElectronicCouponService
{
    @Autowired
    private ElectronicCouponMapper electronicCouponMapper;

    /**
     * 查询电子联单
     * 
     * @param EcNo 电子联单主键
     * @return 电子联单
     */
    @Override
    public ElectronicCoupon selectElectronicCouponByEcNo(Long EcNo)
    {
        return electronicCouponMapper.selectElectronicCouponByEcNo(EcNo);
    }

    /**
     * 查询船舶电子联单登记列表
     * 
     * @param electronicCoupon 电子联单登记列表
     * @return 船舶电子联单登记列表
     */
    @Override
    public List<ShipEcVo> selectShipEcVoList(ElectronicCoupon electronicCoupon)
    {
        return electronicCouponMapper.selectShipEcVoList(electronicCoupon);
    }

    /**
     * 新增电子联单
     * 
     * @param electronicCoupon 电子联单
     * @return 结果
     */
    @Override
    public int insertElectronicCoupon(ElectronicCoupon electronicCoupon)
    {
        electronicCoupon.setCreateTime(DateUtils.getNowDate());
        return electronicCouponMapper.insertElectronicCoupon(electronicCoupon);
    }

    /**
     * 修改电子联单
     * 
     * @param electronicCoupon 电子联单
     * @return 结果
     */
    @Override
    public int updateElectronicCoupon(ElectronicCoupon electronicCoupon)
    {
        return electronicCouponMapper.updateElectronicCoupon(electronicCoupon);
    }

    /**
     * 批量删除电子联单
     * 
     * @param EcNos 需要删除的电子联单主键
     * @return 结果
     */
    @Override
    public int deleteElectronicCouponByEcNos(Long[] EcNos)
    {
        return electronicCouponMapper.deleteElectronicCouponByEcNos(EcNos);
    }

    /**
     * 删除电子联单信息
     * 
     * @param EcNo 电子联单主键
     * @return 结果
     */
    @Override
    public int deleteElectronicCouponByEcNo(Long EcNo)
    {
        return electronicCouponMapper.deleteElectronicCouponByEcNo(EcNo);
    }
}
